<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 100px;
            background: #eee;
        }
    </style>
</head>

<body>
    <div class="box"></div>
    <script>
        var box = document.querySelector('.box')
        box.onclick = function () {
            console.log(this, '点击事件处理函数');
            // 通过箭头修改this指向
            setTimeout(() => {
                console.log(this, 'setTimeout');
                this.style.background = 'deeppink'
            }, 1000)
        }
    </script>
</body>

</html>